package com.dgut.czqqq.exp03.web;

import com.dgut.czqqq.exp03.service.CsvService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
public class GetDataController {

    @Autowired
    private CsvService csvService;

    @RequestMapping("/getGlobalNum")
    public String getGlobalNum() throws IOException {
        return csvService.resolveCsvGetGlobalNum();
    }

    @RequestMapping("/getOneCountryNum")
    public String getOneCountryNum(String searchCoutryName) throws IOException {
        return csvService.resolveCsvGetOneCountryNum(searchCoutryName);
    }
}
